import ajax from '../utils/ajax';

const form = document.forms[0];

form.onsubmit = function (e) {
    e.preventDefault();
    ajax('post', '/api/userreg', { username: form.uid.value, password: form.pwd.value }).then(function (result) {
        alert(result.msg);
        location = '/login.html';
    })
}